package top.banner.es;

import org.elasticsearch.action.admin.indices.delete.DeleteIndexRequest;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.client.RequestOptions;
import org.elasticsearch.client.RestHighLevelClient;

import java.io.IOException;

/**
 * @author XGL
 */
public class IndexDelete {


    public static void main(String[] args) throws IOException {
        final RestHighLevelClient client = ESClient.init();

        final DeleteIndexRequest request = new DeleteIndexRequest("user1");

        final AcknowledgedResponse response = client.indices().delete(request, RequestOptions.DEFAULT);

        System.out.println("删除结果：" + response.isAcknowledged());

        client.close();
    }
}
